package cn.myschool.test;

import cn.myschool.model.HelloSpring;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author oldliu
 * @since 1.0
 */
public class SpringTest3 {
    public static void main(String[] args) {
        ApplicationContext app=new ClassPathXmlApplicationContext("app*.xml");
        HelloSpring hello = app.getBean("hello", HelloSpring.class);
        hello.sayHi();
        HelloSpring hello2 = app.getBean("b", HelloSpring.class);
        System.out.println(hello==hello2);//同一个对象
    }
}
